<template>
	<view class="offical">
		<image mode="widthFix" class="img" :src="zytStore.top_img"></image>
		<video :src="zytStore.video_url" controls autoplay loop muted
			style="width: 100%;height: 200px; margin: auto;"></video>
		<image mode="widthFix" class="img"  :src="zytStore.bom_img" ></image>
		<view class="bents" @click="gotohome">
			跳过
		</view>
	</view>
</template>

<script>
	import {
		AdverList
	} from '@/config/api.js'
	export default {
		data() {
			return {
				zytStore: {},
			}
		},

		methods: {
			gotohome(){
				uni.switchTab({
					url: `/pages/home/home`,
				});
			},
			onPlay() {
				console.log("视频已播放")
			},
			onPause() {
				console.log("视频已暂停")
			},
			gotoGoods(){
				uni.navigateTo({
					url: `/moduleA/storeList/markAddress?title=周壹淘公司&storeId=${this.zytStore.pt_id}&navId=1&markId=${this.zytStore.markId}`,
				});
			},
			// 获取公司信息
			_getzytSyore() {

				AdverList().then(data => {
					console.log(data, '公司信息获取成功')

					// data['platformInvestment'] = data['platformInvestment'].replace(
					// 	/<img [^>]*src=['"]([^'"]+)[^>]*>/gi,
					// 	function(match, capture) {
					// 		return `<img src="${capture}" class="testImg" />`;
					// 	});
					// console.log(data.platformInvestment);
					this.zytStore = data
				}).catch(err => {
					console.log('公司信息获取失败：', err)
				})
			},

		},
		mounted() {
			this._getzytSyore();
		},
		onLoad(option) {
			console.log(option.zytStore)
		}
	}
</script>

<style lang="scss" scoped>
	.bents{
		position: fixed;
		top:100rpx;
		right: 20rpx;
		width: 100rpx;
		height: 60rpx;
		line-height: 60rpx;
		background: #fff;
		color: #333;
		text-align: center;
		font-size: 24rpx;
	}
	@import 'offical.scss';
	.img{
		width: 100%;
	}
	@keyframes pulse {

		0%,
		100% {
			transform: scale(1);
			/* 初始和结束状态，放大1.2倍 */
		}

		50% {
			transform: scale(1.2);
			/* 中间状态，放大1.4倍 */
		}
	}

	.clearinghouse {
		/* 初始缩放为1（100%大小） */
		animation: pulse 2s ease-in-out infinite;
		/* 应用动画，持续时间为5秒，无限循环 */
	}
</style>